import { defineStore } from 'pinia';
import { ref } from 'vue';

const useUserInfoStore = defineStore('userInfo', () => {
    // 定义用户信息
    const info = ref({});

    // 设置用户信息
    const setInfo = (newInfo) => {
        info.value = newInfo ;
    };

    // 清除用户信息
    const removeInfo = () => {
        info.value = {};
    };

    return {
        info,
        setInfo,
        removeInfo
    };
},{persist: true })

export default useUserInfoStore;